<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>登录账号</title>
    <link rel="stylesheet" href="../../../Public/Css/SignUpStyle.css">
    <link href="https://fonts.googleapis.com/css?familymPermanent+Marker" >
    <script language="JavaScript" type="text/JavaScript">
        function isEmail(value){
            pattern = "/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,})$/";
            if(preg_match(pattern,value)==true || value==null){
                return true;
            } else{
                return false;
            }
        }

        function check(form){
        var ID = form.ID.value;
        if(ID.length==0){
        alert("请填写账号！");
        form.ID.focus();
        return false;
        }

        var passwd = form.passwd.value;
        if(passwd.length==0){
        alert("请填写密码！");
        form.passwd.focus();
        return false;
        }
        }
    </script>
</head>
<?php
    session_start();
    include_once("../../../Functions/is_login.php");
    if(is_login()){
        echo "<script>window.location.href='../../index.php';</script>";
        echo "欢迎".$_SESSION['userid']."访问系统！<br/>";
        echo "<a href='user_modify.php'>修改个人信息</a><br/>";
        echo "<a href='look_user.php'>查看用户信息</a><br/>";
        echo "<a href='add_admin.php'>添加管理员</a><br/>";
        echo "<a href='Search_user.php'>搜索用户</a><br/>";
        echo "<a href='logout.php'>注销</a>";
    }
?>
<body>
<div class="sign-div">
    <form class="" action="../Action/login_action.php" method="post" name="input" onSubmit="return check(this);">
        <h1>登录</h1>
        <input class="sign-text" type="text" placeholder="账号" name="ID">
        <input class="sign-text" type="password" placeholder="密码" name="passwd">
        <input class="sign-btn" type="submit" value="登录">
        <a href="http://localhost:8080/PHP-NEWS-RELEASE-SYSTEM/Application/User/Page/register.php">还没有账户?</a>
    </form>
</div>
</body>
</html>


